package com.zc.campus_shops.dto;

public class Result<T>{
	
	//是否成功的标识
	private boolean success;

	//成功时返回的数据
	private T data;
	
	//错误时返回的信息
	private String errorMsg;

	//错误时返回的状态码
	private int errorCode;
	
	public Result(){}
	//成功时的构造器
	public Result(boolean success,T data){
		this.success = success;
		this.data = data;
	}
	
	//错误时的构造器
		public Result(boolean success,int errorCode,String errorMsg){
			this.errorMsg = errorMsg;
			this.success = success;
			this.errorCode = errorCode;
		}
		
	public boolean isSuccess(){
		return success;
	}
	public T getData() {
		return data;
	}
	public void setData(T data) {
		this.data = data;
	}
	public String getErrorMsg() {
		return errorMsg;
	}
	public void setErrorMsg(String errorMsg) {
		this.errorMsg = errorMsg;
	}
	public int getErrorCode() {
		return errorCode;
	}
	public void setErrorCode(int errorCode) {
		this.errorCode = errorCode;
	}
	public void setSuccess(boolean success) {
		this.success = success;
	}
	
}
